package com.ewing.busi.stat.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.ewing.busi.order.dao.OrderDetailDao;
import com.ewing.busi.stat.dao.StatAccessLogDao;

@Repository("mainStatService")
public class MainStatService {
    @Resource
    private OrderDetailDao orderDetailDao;
    @Resource
    private StatAccessLogDao statAccessLogDao;

    /**
     * 查询需要商户处理的订单数
     */
    public Integer countWaitProOrder(Integer userId) {
        return orderDetailDao.countWaitProOrder(userId);
    }

    /**
     * 查询商户所有的历史收入
     * 
     * @param userId
     * @return
     */
    public Float countIncomeHistory(Integer userId) {
        return orderDetailDao.countIncomeHistory(userId);
    }

    /**
     * 获取昨日商店访问量
     * 
     * @param shopId
     * @return
     */
    public Integer getYesterdayAccessCount(Integer shopId) {
        return statAccessLogDao.getYesterdayAccessCount(shopId);
    }
}
